<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$wzxx_title ='留言中心-'.$wzxx_title.'';
$wzxx_gj    ='留言中心-'.$wzxx_gj.'';
$wzxx_ms    ='留言中心-'.$wzxx_ms.'';
if($_POST['text']){
   $name  =$_POST['name'];
   $namem =$_POST['namem'];
   $qq    =$_POST['qq'];
   $mobile=$_POST['mobile'];
   $email =$_POST['email'];
      $liuyan  =$db->get_one('ly'," `uip` ='$ip' ORDER BY `id` DESC LIMIT 0 , 1 ",'');
      
      if(empty($name) or empty($qq) or empty($mobile) or empty($email)){
   	      $tsmm="不能为空！";
	    }elseif($_COOKIE['liuyan']){
   	      $tsmm="留言太快！请稍候提交！";
	    }elseif(($time-$liuyan[time_a]) < '600'){
   	      $tsmm="留言太快！请稍候提交！";
	    }elseif(!preg_match("/^1[0-9]{1}[0-9]{9}$/",$mobile)){
   	      $tsmm="手机号有误！";
	    }elseif(!preg_match("/^([0-9A-Za-z\-\_])+@([0-9a-zA-Z\.])+([0-9A-Za-z\.])+$/",$email)){
   	      $tsmm="邮箱有误！";
      }else if($db->insert('ly',array('id' => 'NULL' ,'uid' => $user_uid,'uip' => $ip,'type' => 0,'qq' => $qq,'mobile' => $mobile,'email' => $email,'name' => $namem,'content' => $name,'time_a' => $time))){
   	      setcookie('liuyan','time','600');
   	      $tsmm="留言成功！";
      }else{
   	      $tsmm="留言失败！";
      }
   	  $pdid='1';
}
@include template('head');
@include template('user/user_liuyan');
@include template('foot');
?>